﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace LI4
{
    public partial class main2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] != null)
            {
                lblUsername.Text = Session["username"].ToString();
                lblDate.Text = DateTime.Now.ToString("D");
            }
            else Response.Redirect("main.aspx");
            frame1.Attributes["src"] = "center.aspx";

        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            if(Program.Login.Tipo == Business.Login.CANDIDATO)

            frame1.Attributes["src"] = "perfil.aspx";

            else
                frame1.Attributes["src"] = "perfilEmpresa.aspx";
        }

        protected void LinkButton1_Click1(object sender, EventArgs e)
        {
            frame1.Attributes["src"] = "escolhaPesquisaEmpresa.aspx";
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            frame1.Attributes["src"] = "escolhaPesquisaCandidato.aspx";
        }

        protected void LinkButton3_Click(object sender, EventArgs e)
        {
            frame1.Attributes["src"] = "escolhaPesquisaCurso.aspx";
        }

        protected void LinkButton4_Click(object sender, EventArgs e)
        {
            frame1.Attributes["src"] = "criarAnuncio.aspx";
        }

        protected void LinkButton5_Click(object sender, EventArgs e)
        {
            frame1.Attributes["src"] = "escolhaPesquisaAnuncio.aspx";
        }

        protected void LinkButton6_Click(object sender, EventArgs e)
        {
            Session["username"] = null;
            Response.Redirect("main.aspx");
        }

        public void logout()
        {
            Session["username"] = null;
            Response.Redirect("main.aspx");
        }
        
    }
}
